﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MongoDB.Bson;
using MongoDB.Driver;
using System.Configuration;

namespace Chaine.DAO
{
    public class DB
    {
        private static MongoDatabase _DB;
        public static MongoDatabase GetDBInstance()
        {
            
                var server = MongoServer.Create(ConfigurationManager.AppSettings["MongoDBConnectionString"]);
                if (_DB == null)
                    _DB = server.GetDatabase(ConfigurationManager.AppSettings["DatabaseName"]);
                return _DB;
            
        }
    }
}